/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.editparts;

import java.beans.PropertyChangeEvent;

import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.NodeEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.editpolicies.DirectEditPolicy;

import edu.pku.sei.modeler.model.structure.MetaShapeElement;

/**
 * @author zhaoyi
 *
 */
public class MetaInterfaceEditPart extends MetaNamedElementEditPart implements
		NodeEditPart {
 
	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 */
	public MetaInterfaceEditPart(MetaShapeElement model) {
		super(model);
	}
	protected IFigure createFigure() {
//		Label header = new Label();
//		Interface model = (Interface) 
//			((Node)getModel()).getModel();
//		header.setBorder(new MarginBorder(0, 0, 1, 0));
//		header.setText(model.getName());
//		header.setIcon(UMLViewImages.getImage(UMLViewImages.INTERFACE));
//		UMLInterfaceFigure fig = new UMLInterfaceFigure(header);
////		IFigure body = fig.getOpCompart();
//		List v = model.getOwnedOperation();
//		IFigure opCompart = fig.getOpCompart();
//		for(int i=0; i<v.size(); i++)
//		{
//			SelectableLabel attr = new SelectableLabel();
//			attr.setText("test");
//			attr.setIcon(UMLViewImages.getImage(UMLViewImages.FIELD_PUBLIC));
//			opCompart.add(attr);
//		}
//		return fig;
		return null;
	}

	protected DirectEditPolicy createDirectEditPolicy() {
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
	 */
	protected void createEditPolicies() {
		super.createEditPolicies();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
	 */
	public ConnectionAnchor getSourceConnectionAnchor(
			ConnectionEditPart connection) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
	 */
	public ConnectionAnchor getTargetConnectionAnchor(
			ConnectionEditPart connection) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
	 */
	public ConnectionAnchor getSourceConnectionAnchor(Request request) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.Request)
	 */
	public ConnectionAnchor getTargetConnectionAnchor(Request request) {
		// TODO Auto-generated method stub
		return null;
	}

	protected void handlePropertyChanged(PropertyChangeEvent event) {
		super.handlePropertyChanged(event);
	}
	/* (non-Javadoc)
	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
	 */
	public void propertyChange(PropertyChangeEvent evt) {
		
	}
	
	protected void refreshVisuals() {
		super.refreshVisuals();
	}
}
